package com.seminario.rest;

import javax.jws.WebService;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import com.google.gson.Gson;
import com.seminario.dao.RegistroDao;

@WebService
@Path("/registro")
public class RegistroWS {
	
	Gson gson = new Gson();
	RegistroDao registroDao = new RegistroDao();
	
	@GET
	@Produces(MediaType.APPLICATION_JSON)
	public Response registrooGET() {
		
		String cadenaJson = gson.toJson(registroDao.getAllRecords());

		return Response.status(200).entity(cadenaJson).build();
	}
	
}
